package com.scut.scutzone.dao;

import com.scut.scutzone.entity.Comment;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

/**
 * @author: lifeng Chan
 * @date: 2021/4/29 13:36
 * @description:
 * 获取评论相关的dao接口
 */
@Repository
public interface CommentAccess {
    Comment getCommentById(@Param("comment_id") int comment_id);
    //String为对应用户名
    List<Comment> getCommentsByPostId(@Param("post_id") int parent_id, @Param("limit") int limit);
    List<Comment> getCommentsByCommentId(@Param("comment_id") int parent_id,@Param("limit") int limit);

    void insertComment(@Param("c") Comment comment);
    //调整目标评论的评论数 0为减少
    void adjustCommentNum(@Param("comment_id") int comment_id,@Param("increase") boolean increase);


    void modifyCommentById(@Param("comment_id") int comment_id,@Param("content") String content,@Param("img_name") String img_name);
    void deleteCommentById(@Param("comment_id") int comment_id);

}
